package com.econ.powercloud.ems.common.enums;

/**
 * @author zjr
 * @description 量测类型
 */
public enum MeasureType implements EnumMethod{
    //遥信
    yx(1, 1,"遥信"),
    //遥测
    yc(0, 0,"遥测"),;

    private Integer code;
    private Integer codeInIot;
    private String desc;

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getDesc() {
        return desc;
    }

    public Integer getCodeInIot() {
        return codeInIot;
    }

    MeasureType(int code, int codeInIot,String desc){
        this.code=code;
        this.codeInIot=codeInIot;
        this.desc=desc;
    }

    public static Integer fromCodeInIot(Integer codeInIot){
        for(MeasureType type: MeasureType.values()){
            if(type.getCodeInIot().equals(codeInIot)){
                return type.getCode();
            }
        }
        return null;
    }

}
